# 设置初始的账号密码
acc_pwd_lis = [["冯健钊", "0212"], ["李四", "2222"], ["王五", "3333"]]

# 用户输入
is_login = False  # 设置是否登录成功的初始值

for i in range(3):  # 0, 1, 2
    user_acc = input("请输入账号：")

    # 检查账号是否存在
    acc_exists = False
    for acc_pwd in acc_pwd_lis:
        acc = acc_pwd[0]
        if acc == user_acc:
            acc_exists = True
            break

    if not acc_exists:
        count = 3 - (i + 1)
        print(f"账号不存在，还剩余{count}尝试机会")
        continue

    user_pwd = input("请输入密码：")

    # 检查密码是否正确
    for acc_pwd in acc_pwd_lis:
        acc = acc_pwd[0]
        pwd = acc_pwd[1]
        if acc == user_acc and pwd == user_pwd:
            print("登录成功")
            is_login = True
            break

    if is_login:
        break
    else:
        count = 3 - (i + 1)
        print(f"登录失败，还剩余{count}尝试机会")

if not is_login:
    print("拒绝登录")